package com.ruoyi.mespro.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mespro.mapper.ShaftDefectMapper;
import com.ruoyi.mespro.domain.ShaftDefect;
import com.ruoyi.mespro.service.IShaftDefectService;

/**
 * 疵点管理Service业务层处理
 *
 * @author JunXiang
 * @date 2022-08-02
 */
@Service
public class ShaftDefectServiceImpl implements IShaftDefectService
{
    @Autowired
    private ShaftDefectMapper shaftDefectMapper;

    /**
     * 查询疵点管理
     *
     * @param id 疵点管理主键
     * @return 疵点管理
     */
    @Override
    public ShaftDefect selectShaftDefectById(Long id)
    {
        return shaftDefectMapper.selectShaftDefectById(id);
    }

    @Override
    public ShaftDefect selectShaftDefectByShaftCode(String shaftcode) {
        return shaftDefectMapper.selectShaftDefectByShaftCode(shaftcode);
    }

    /**
     * 查询疵点管理列表
     *
     * @param shaftDefect 疵点管理
     * @return 疵点管理
     */
    @Override
    public List<ShaftDefect> selectShaftDefectList(ShaftDefect shaftDefect)
    {
        return shaftDefectMapper.selectShaftDefectList(shaftDefect);
    }

    /**
     * 新增疵点管理
     *
     * @param shaftDefect 疵点管理
     * @return 结果
     */
    @Override
    public int insertShaftDefect(ShaftDefect shaftDefect)
    {
        shaftDefect.setCreateTime(DateUtils.getNowDate());
        return shaftDefectMapper.insertShaftDefect(shaftDefect);
    }

    /**
     * 修改疵点管理
     *
     * @param shaftDefect 疵点管理
     * @return 结果
     */
    @Override
    public int updateShaftDefect(ShaftDefect shaftDefect)
    {
        shaftDefect.setUpdateTime(DateUtils.getNowDate());
        return shaftDefectMapper.updateShaftDefect(shaftDefect);
    }

    /**
     * 批量删除疵点管理
     *
     * @param ids 需要删除的疵点管理主键
     * @return 结果
     */
    @Override
    public int deleteShaftDefectByIds(Long[] ids)
    {
        return shaftDefectMapper.deleteShaftDefectByIds(ids);
    }

    /**
     * 删除疵点管理信息
     *
     * @param id 疵点管理主键
     * @return 结果
     */
    @Override
    public int deleteShaftDefectById(Long id)
    {
        return shaftDefectMapper.deleteShaftDefectById(id);
    }
}
